import asyncio
async def wget(hots):
    print('wget %s...' % hots)
    content=asyncio.open_connection(hots,80)
    reader, writer = await content
    header='GET / HTTP / 1.0 \r\n Host:%s\r\n\n' % hots
    writer.write(header.encode('utf-8'))
    await writer.drain()###await是在对象返回结果的时候使用，而不是在生成对象的时候调用，
    while True:
        line = await reader.readline()##### 貌似await都是在等待结果，而不是等待对象？？？？？？？？
        if line ==b'\r\n':
            break
        print('%s header > %s' % (hots, line.decode('utf-8').rstrip()))
    writer.close()
loop = asyncio.get_event_loop()
tasks= [wget(host) for host in ['www.sina.com.cn', 'www.sohu.com', 'www.163.com']]
loop.run_until_complete(asyncio.wait(tasks))
loop.close()